﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using SosData;
using SosForms;

namespace UOCmaker
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void romButton1_Click(object sender, EventArgs e)
        {
            SosData.sosContext context = new SosData.sosContext();

            FormBuscar f = new FormBuscar(typeof(SosData.User), context.Users.AsQueryable());
            f.Show();
        }

        private void romButton2_Click(object sender, EventArgs e)
        {
            User us = new User();
            us.email = "email2@gmail.com";
            us.IdUser = new Random().Next();
            us.Name = "Name" + us.IdUser.ToString();
            us.NickName = "NickName" + us.IdUser.ToString();

            var context = new sosContext();
            context.Users.Add(us);
            context.SaveChanges();
        }
    }
}
